fix: make IMAGE_TAG
available in buildArgs when used in docker FROM
#9450
+40
−22
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related:
Description
Apologies if I am simply misunderstanding something and this can be fixed w/out a code change. I am certainly not fully wrapping my head around this codebase.
This PR adds the ability to use
IMAGE_TAG
(IMAGE_REPO etc) in the docker buildArgs section, specifically when the build arg is then consumed in the DockerfileFROM
. On current stable and main, this case fails in the depList / SingleArtifactDependencies phase, with logs like:Note that when used with dependencies (as below), this seems to only work reliably if I run
skaffold build && skaffold run
. skaffold run by itself will sometimes fail with 'image not found remotely'.Repro
Stripped-down skaffold.yaml:
Top of
child/Dockerfile
:tldr the second artifact depends on the first and then uses it as a base image
User facing changes
I think the docs already imply this is possible
Follow-up Work
No idea if I'm conforming to house style -- if accepted, guessing someone on the team will need to clean up or at least assign me cleanup. I would normally have submitted a bug rather than a PR for something like this, but I didn't understand why my template param was missing until I'd already solved the problem.
If this is something useful, happy to add tests etc.